<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<jsp:include page="/common/taglib.jsp"/>
<%@ taglib prefix="c" uri="/WEB-INF/c.tld" %>
<html>
  <head>
    <title>会员注册</title>
    <link href="${contextPath }/css/style.css" rel="stylesheet" type="text/css" />
    <link href="${contextPath }/js/validate/jquery.validate.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="${contextPath }/js/jquery.js"></script>
    <script type="text/javascript" src="${contextPath }/js/validate/jquery.validate.js"></script>
    <script type="text/javascript" src="${contextPath }/js/validate/messages_cn.js"></script>
  </head>
  <body>
  	<jsp:include page="/common/header.jsp"></jsp:include>
  	<div class="search" style="padding-left:90px;width:860px;">
		<a class="logo" href="${contextPath }/"><img src="${contextPath }/images/logo.gif"></a>		
	</div>
  	<div class="content" style="width:700px;height:380px;border:1px solid #CCC;padding:40px 30px;background:url('images/reglinebg.gif') repeat-x scroll 0 0 transparent">
		<h3 style="font-size:16px;padding-left:25px;">会员注册</h3>
    <form id="registform" action="${contextPath}/auth/user/regist.do" method="post">
    <ul class="regist-ul">
    	<li><div class="cleft"><p><span class="red">*</span>帐号：</p><input type="text" name="username" value=""/></div><div class="cright"></div></li>
    	<li><div class="cleft"><p><span class="red">*</span>昵称：</p><input type="text" name="nickName" value=""/></div><div class="cright"></div></li>
    	<li><div class="cleft"><p><span class="red">*</span>密码：</p><input id="password" type="password" name="password" value=""/></div><div class="cright"></div></li>
    	<li><div class="cleft"><p><span class="red">*</span>验证密码：</p><input type="text" type="password" name="password2" value=""/></div><div class="cright"></div></li>
    	<li><div class="cleft"><p><span class="red">*</span>电子邮件：</p><input type="text" name="email" value=""/></div><div class="cright"></div></li>
    </ul>
    	<button class="regist" type="submit">同意三喜协议并注册</button><button type="reset">清空</button>
    </form>
    </div>
    <jsp:include page="/common/footer.jsp"></jsp:include>
    <script type="text/javascript">
		$(function(){
			$("#registform").validate({
				focusInvalid:false,
				onkeyup:false,
				rules:{
					username:{
						required:true,
						rangelength:[4,16]
						//remote:"verifyuser.do"
					},
					nickName:{
						required:true,
						rangelength:[2,10]
					},
					password:{
						required:true,
						rangelength:[4,16]
					},
					password2:{
						required:true,
						rangelength:[4,16],
						equalTo:"#password"
					},
					email:{
						required:true,
						email:true
					}
				},
				messages:{
					username:{
						required:"帐号是必须的",
						rangelength:"长度为{0}到{1}之间",
						remote:"${0}已经被占用，请换一个"
					},
					password:{
						required:"密码是必须的",
						rangelenth:"长度为{0}到{1}之间"
					},
					password2:{
						required:"密码验证是必须的",
						rangelength:"长度为{0}到{1}之间",
						equalTo:"验证密码必须和原密码相同"
					},
					nickName:{
						required:"昵称是必须的",
						rangelength:"长度为{0}到{1}之间"
					},
					email:{
						required:"邮箱是必须的",
						email:"必须为合法的邮箱地址"
					}
				},
				highlight:function(element,errorClass){
					$(element).addClass(errorClass);
				},
				errorPlacement:function(error,element){
					$(error).appendTo($(element).parent("div").next("div"));
				},
				success:function(label){
					$(label).addClass("checked").text("OK!");
				}
			});
		});		
    </script>
  </body>
</html>
